#!/bin/bash
sudo docker stop spider-flow
cd /home/tisson/spider-flow/
sudo rm -rf spider-flow
sudo rm -rf *.zip
wget https://gitee.com/Sea-Monster/spider-flow/repository/archive/master.zip
unzip master.zip
sudo docker rm spider-flow
sudo docker rmi spider-flow:latest
cd spider-flow
sudo mvn clean package -D maven.test.skip=true -f pom.xml
cp spider-flow-api/target/spider-flow-api-0.2.1.jar /home/tisson/dockerfiles/spider-flow/
cp spider-flow-core/target/spider-flow-core-0.2.1.jar /home/tisson/dockerfiles/spider-flow/
cp spider-flow-web/target/spider-flow.jar /home/tisson/dockerfiles/spider-flow/
cp spider-flow-web/target/spider-flow-web-0.2.1.jar /home/tisson/dockerfiles/spider-flow/
cd /home/tisson/dockerfiles/spider-flow
sudo docker build -f Dockerfile -t spider-flow:latest .
sudo docker run --name=spider-flow  -v /etc/localtime:/etc/localtime:ro -v /home/tisson/files_crawler:/root/data/ --cpus=4 -m 4G --memory-swap=4G --add-host ctyun1:47.112.138.184 --add-host ctyun2:47.112.138.184 --add-host ctyun3:47.112.138.184 -p 48088:8088 -d --restart=on-failure spider-flow:latest
echo 'over'